//
//  DateUtil.h
//  yidao
//
//  Created by 学彬 蔡 on 14-1-9.
//  Copyright (c) 2014年 学彬 蔡. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NSDate+Category.h"
#import "NSDate+Category.h"
@interface DateUtils : NSObject

//格式化字符串yyyy-mm-dd hh-mm-ss
+(NSString *)formatDate:(NSDate *) date;
+(NSString *)formatStrToDate:(NSString*) date;
//获得格式为yyyy-mm-dd的NSDateComponents对象
+(NSDateComponents *)getDateComponents:(NSDate*) date;
//格式化日期字符串——@"YYYY-MM-DD"
+(NSString*)dateToStringByFormat:(NSDate *)date format:(NSString*)format;
//返回nex day
+(NSDate *)nextDay:(NSDate *)date;
//返回prev day
+(NSDate *)previousDay:(NSDate *)date;


//返回nex month
+(NSDate *)nextMonth:(NSDate *)date;
//返回prev month
+(NSDate *)previousMonth:(NSDate *)date;
+(NSDate *)previousYear:(NSDate *)date;


//是否是今天
+(BOOL)isToday:(NSDate*)date;
//是否这个月
+(BOOL)isThisMonth:(NSDate*)date;

//获取10年的月日
+(NSArray*)PreYearMonth;
+(NSArray*)PreNearYearMonth;
+(NSMutableArray*)PreMonth;
+(NSArray*)nearYearMonth;
+(NSUInteger)getMonthDays;

+ (unsigned long long)getFirstDayOfWeek:(unsigned long long)timestamp;
+ (unsigned long long)getFirstDayOfQuarter:(unsigned long long)timestamp;
+ (unsigned long long)getFirstDayOfMonth:(unsigned long long)timestamp;
+ (unsigned long long)getLastDayOfMonth:(unsigned long long)timestamp;
+ (unsigned long long)getLastDayOfYear:(unsigned long long)timestamp;
+ (unsigned long long)getFirstDayOfYear:(unsigned long long)timestamp;
+ (unsigned long long)getLastDayOfQuarter:(unsigned long long)timestamp;
@end